import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
import Home from '../components/Home.vue'
import Welcome from '../components/Welcome.vue'
import WarnPath from '../components/Warn.vue'
import ShowInfo from '../components/ShowInfo.vue'
import SearchInfoByDate from '../components/SearchInfoByDate.vue'
import SearchInfoByRegion from '../components/SearchInfoByRegion.vue'
import SearchInfoByRank from '../components/SearchInfoByRank.vue'
import InfoServer from '../components/InfoServer.vue'
import Chart from '../components/Chart.vue'

Vue.use(VueRouter)

const routes = [
  //{ path: '/login', component: Login }
]

const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/login', component: Login },
    {
      path: '/home',
      component: Home,
      redirect: '/welcome',
      children: [
        { path: '/welcome', component: Welcome },
        { path: '/warn', component: WarnPath },
        { path: '/showInfo', component: ShowInfo },
        { path: '/searchInfoByDate', component: SearchInfoByDate },
        { path: '/searchInfoByRegion', component: SearchInfoByRegion },
        { path: '/searchInfoByRank', component: SearchInfoByRank },
        { path: '/infoServer', component: InfoServer },
        { path: '/chart', component: Chart }
      ]
    }
  ]
})

export default router
